package com.prosay.exchange;

public class ThreadDemo {
    public static void main(String[] args) {
		Thread thread1 = new ThreadDemo2();
		Thread thread2 = new ThreadDemo2();
		thread1.start();
		thread2.start();
	}
}
class ThreadDemo2 extends Thread{
	public static int num = 0;
	@Override
	public void run(){
		while(true){
			if(num>10){
				break;
			}
			num++;
			System.out.println(Thread.currentThread());
		}
	}
	
}
